package com.ygo.feihua;

import android.content.*;
import android.view.*;
import android.widget.*;
import cn.bmob.v3.datatype.*;
import java.util.*;

public class Kditem extends BaseAdapter
{
	List<Map<String,Object>> data;
	Context context;
	private TextView kd_item_name,kd_item_dz;
	public Kditem(Context context, List<Map<String,Object>> data)
	{
		this.context = context;
		this.data=data;
	}


	public void addItem(Map<String,Object> map)
	{
		data.add(map);
		notifyDataSetChanged();
	}

	@Override
	public int getCount()
	{
		return data.size();
	}

	@Override
	public Object getItem(int position)
	{
		return data.get(position);
	}

	@Override
	public long getItemId(int position)
	{
		return position;
	}

	@Override
	public View getView(final int position, View convertView, ViewGroup parent)
	{
		View view = LayoutInflater.from(context).inflate(
			R.layout.kditem, null);
		kd_item_name=(TextView) view.findViewById(R.id.kd_item_name);
		kd_item_dz=(TextView) view.findViewById(R.id.kd_item_dz);

		kd_item_name.setText((String)data.get(position).get("name"));
		kd_item_dz.setText((String)data.get(position).get("dz"));
		
		
		
		
		
		
		return view;
	}
	

}
